use serde::{Deserialize, Serialize};
use chrono::{DateTime, Utc};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct CreateUserRequest {
    pub username: String,
    pub password: String,
    pub home_directory: String,
    pub max_storage_size: Option<i64>,
}

impl CreateUserRequest {
    pub fn new(username: String, password: String, home_directory: String) -> Self {
        Self {
            username,
            password,
            home_directory,
            max_storage_size: None,
        }
    }
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LoginRequest {
    pub username: String,
    pub password: String,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct LoginAttempt {
    pub username: Option<String>,
    pub client_ip: String,
    pub success: bool,
    pub attempted_at: DateTime<Utc>,
    pub user_agent: Option<String>,
}
